$(function () {
    $('.status').click(function () {
        let that = $(this);
        let id = that.attr("data-id");

        // 发送ajax请求
        $.ajax({
            url:"/admin/managerStatus",//请求的地址
            data:{id:id},
            dataType:"json",
            type:"post",
            success:function (response) {
                //修改成功
                if (response.code == 200) {
                    alert(response.msg);
                    if (response.data.status == 1) {
                        that.html("<font color='red'>可用</font>")
                    } else {
                        that.html("<font color='blue'>禁用</font>")
                    }
                } else {
                    alert(response.msg);
                }

            }
        })
    })
})